*{
  margin: 0;
  padding: 0;
}
.root {
  width: 100vw;
  height: 100vh;
}
h1 {
  text-align: center;
}
.container{
  width: 90%;
  margin: 20px auto 0;
  display: flex;
}
.editor {
  flex: 0 1 50%;
  border: 1px solid #eee;
  display: flex;
  flex-flow: column nowrap;
}
.editor-item > h2 {
  line-height: 30px;
}
.editor-item > textarea {
  overflow: auto;
  background-color: #000;
  color: #fff;
  width: 100%;
  height: 350px;
}
.preview {
  flex: 0 1 50%;
  border: 1px solid #eee;
  padding: 10px;
  overflow: auto;
}
.control{
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}
.control > button {
  margin: 5px;
}
.rectangle-container{
  height: 550px;
  border: 2px solid #000;
  position: relative;
  overflow: hidden;
}
.rectangle-container img {
  margin: 0 auto;
  pointer-events: none;
  user-select: none;
}
.rect{
  position: absolute;
  box-shadow: 0 0 0 1999px rgba(0, 0, 0, .4);
  left: -9999px;
  top: 0;
  width: 0;
  height: 0;
  border: 1px solid #fa9120;
  cursor: move;
}
.rect>span{
  position: absolute;
  width: 6px;
  height: 6px;
}
.rect .left-top{
  left: 0;
  top: 0;
  cursor: nwse-resize;
}
.rect .middle-top{
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  cursor: n-resize;
}
.rect .right-top{
  right: 0;
  top: 0;
  cursor: nesw-resize;
}
.rect .right-middle{
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  cursor: e-resize;
}
.rect .right-bottom{
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}
.rect .middle-bottom{
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  cursor: s-resize;
}
.rect .left-bottom{
  left: 0;
  bottom: 0;
  cursor: nesw-resize;
}
.rect .left-middle{
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  cursor: w-resize;
}